//
//  CardView.m
//  niminban
//
//  Created by zhouteng on 16/10/1.
//  Copyright © 2016年 zhouteng. All rights reserved.
//

#import "CardView.h"

@implementation CardView
-(instancetype)init{
    self = [super init];
    if(self){
        _cornerRadius = 2;
        _shadowOffsetWidth=0;
        _shadowOffsetHeight=3;
        _shadowColor=[UIColor blackColor];
        _shadowOpacity=0.5;
    }
    return self;
}
-(void)layoutSubviews{
    self.layer.cornerRadius = _cornerRadius;
    UIBezierPath *shadowPath = [UIBezierPath bezierPathWithRoundedRect:self.bounds cornerRadius:_cornerRadius];
    
    self.layer.masksToBounds = NO;
    self.layer.shadowColor = _shadowColor.CGColor;
    self.layer.shadowOffset = CGSizeMake(_shadowOffsetWidth, _shadowOffsetHeight);
    self.layer.shadowOpacity = _shadowOpacity;
    self.layer.shadowPath = shadowPath.CGPath;
}

@end
